#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@shadowsocksr[-1]
add ucitrack shadowsocksr
set ucitrack.@shadowsocksr[-1].init=shadowsocksr
commit ucitrack
delete firewall.shadowsocksr
set firewall.shadowsocksr=include
set firewall.shadowsocksr.type=script
set firewall.shadowsocksr.path=/var/etc/shadowsocksr.include
set firewall.shadowsocksr.reload=1
commit firewall
EOF
chmod 0755 /etc/init.d/shadowsocksr /usr/bin/ssr-* /usr/share/shadowsocksr/*.sh
chmod 0644 /etc/ssr/* \
/usr/share/shadowsocksr/*.lua \
/usr/share/rpcd/acl.d/luci-app-ssr-plus.json \
/usr/lib/lua/luci/model/cbi/shadowsocksr/*.lua \
/usr/lib/lua/luci/view/shadowsocksr/*.htm
chmod 0600 /etc/config/shadowsocksr
touch /etc/ssr/china_ssr.txt
touch /etc/ssr/white.list
touch /etc/ssr/black.list
touch /etc/ssr/netflix.list
touch /etc/ssr/netflixip.list
touch /etc/ssr/ad.conf
touch /etc/ssr/gfw_list.conf
touch /etc/ssr/deny.list
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache
exit 0
